<h1>Projects ordered by Supervisor</h1>
<p> <%= link_to "View all", {:action => 'index'} %> | <%= link_to "View by discipline", {:action => 'by_discipline'} %></p>
<%
 curr_staff = '';
%>
<p>
<% if @projects.blank? %>
    <p>no projects to display</p>
<%else%>
  <ul id="projects">
    <% @projects.each do |is| %>
        <%
          if curr_staff == ''
            curr_staff = is.last_name
        %>
      <p><u><%= 'Projects by ' + is.last_name %><br></u></p>        
        <%
          else
            if curr_staff != is.last_name
        %>
        <p><u><%= 'Projects by ' + is.last_name %><br></u></p> 
        <%
              curr_staff = is.last_name
            end
          end
        %>
      <li>

        <%= link_to is.title,
          {:action => 'show', :id => is.id} -%>
      </li>
      <%end%>
  </ul>
<%end%>
